package com.zc.app.quartz;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.io.Serializable;

/**
 * Created by zc on 2016/12/26.
 */
public class HelloJob implements Job, Serializable {
    private static final long serialVersionUID = -8375780203698239313L;

    public static int i = 0;

    private static Logger log = LogManager.getLogger(HelloJob.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("begin begin begin begin begin begin begin begin ! job = "+ ++i);
        log.info("job = "+i+" is running ");
        for(int j = 1 ; j <= 5;j++){//运行5秒
            System.out.print( j +" ");
        }
        System.out.println();
        log.info("end end end end end end end end end end end end ! job = "+ i);
    }
}
